package com.itheima.service;

import com.itheima.api.OmsOrderApi;
import com.itheima.dto.GetOrderDto;
import com.itheima.dto.OmsOrderDto;
import com.itheima.dto.deliveryDto;
import com.itheima.dto.MoneyInfoParam;
import com.itheima.dto.receiverInfoParam;
import com.itheima.vo.MinioVo;
import com.itheima.vo.PageResult;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;


/**
 * @author 芝士雪豹
 * @create 2022/10/13/20:29
 */
@Service
public class OmsOrderService {
    @DubboReference
    private OmsOrderApi omsOrderApi;


    //批量删除订单
    public MinioVo delete(Integer[] ids) {
        MinioVo vo = omsOrderApi.delete(ids);
        return vo;
    }

    //查询订单
    public PageResult findOrder(OmsOrderDto dto) {
        PageResult pageResult = omsOrderApi.findOrder(dto);
        return pageResult;
    }

    //批量关闭接口
    public MinioVo close(Integer[] ids, String note) {
        MinioVo vo = omsOrderApi.close(ids, note);
        return vo;
    }

    //批量发货
    public MinioVo delivery(deliveryDto dto) {
        MinioVo vo = omsOrderApi.delivery(dto);
        return vo;
    }

    //修改订单费用信息
    public MinioVo moneyInfo(MoneyInfoParam moneyInfoParam) {
        MinioVo vo = omsOrderApi.moneyInfo(moneyInfoParam);
        return vo;
    }

    //备注订单
    public MinioVo note(Integer id, String note, Integer status) {
        MinioVo vo = omsOrderApi.note(id, note, status);
        return vo;
    }

    //修改收货人信息
    public MinioVo receiverInfo(receiverInfoParam param) {
        MinioVo vo = omsOrderApi.receiverInfo(param);
        return vo;
    }

    //获取订单详情：订单信息、商品信息、操作记录
    public GetOrderDto getOrder(Integer id) {
        return omsOrderApi.getOrder(id);
    }
}
